package com.zhijian.medical.controller;

import com.zhijian.medical.entity.vo.request.RoutinePatientSearchVo;
import com.zhijian.medical.entity.vo.request.RoutineSampleRegisterVo;
import com.zhijian.medical.entity.vo.response.RoutinePatientVo;
import com.zhijian.medical.enums.PatientEnums;
import com.zhijian.medical.service.RoutinePatientService;
import com.zhijian.response.annotation.Response;
import com.zhijian.util.page.Page;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 术中快速-病人 控制层
 *
 * @author auto
 * @version 1.0
 * @date 2024-06-26 15:42:40
 */
@Slf4j
@Controller
@RequestMapping("/cell")
@Api(tags = "细胞病理-病人")
public class RoutinePatientCellController {

    @Autowired
    private RoutinePatientService service;

    @Response
    @PostMapping("/routine/patient/page/register")
    @ApiOperation("分页查询")
    public Page<RoutinePatientVo> selectRegisterByCondition(@RequestBody(required = false) RoutinePatientSearchVo param) {
        if (param == null)
            param = RoutinePatientSearchVo.builder().build();
        log.info("{} - {}| query info", this.getClass().getSimpleName(), param);
        param.setPatientHandleType(PatientEnums.PatientHandleTypeEnum.CYTOLOGY.getCode());
        return service.selectPage(param);
    }
}
